import { _decorator, Component, log, Node } from 'cc';
import ConfigManager from 'db://assets/component/config/ConfigManager';
import { EventMgr } from 'db://assets/component/event/EventMgr';
const { ccclass, property } = _decorator;

@ccclass('TestConfig')
export class TestConfig extends Component {
    @property(ConfigManager)
    configMag: ConfigManager = null!;

    protected onLoad(): void {
        this.configMag.loadConfigData();
        const config = this.configMag.configData;
        for (let key in config) {
            console.log(
                `Config data loaded for key "${key}":`,
                config[key],
            );
        }
    }

    start() {
        this.configMag.saveConfigData();
    }
}
